﻿using System.Windows.Controls;
using System;

namespace DenisVuyka.Controls.PropertyGrid.Controls
{
  public class EnumDropdown : ComboBox
  {    
    protected override void OnSelectionChanged(SelectionChangedEventArgs e)
    {
      PropertyItemValue value = this.DataContext as PropertyItemValue;
      if (value != null)
      {
        if (!this.SelectedValue.Equals(value.Value)) return;
      }
      base.OnSelectionChanged(e);
    }    
  }
}
